Automated storage and retrieval library systems (including smaller jukeboxes) are used to store large numbers of recording media, such as optical disks or magnetic tape cartridges, in order to maintain large amounts of data available to a host computer. (As used herein, the term "cartridge" will refer to any form of data storage media and its carrier, including, without limitation, magnetic tape cartridges and cassettes and optical disk cartridges and trays.) The library operator may desire to backup or copy certain data from one cartridge to another for archival or security purposed. Two approaches can be used. If the library has a single drive unit, a "single-threaded" procedure is employed as follows: the cartridge on which the data to be copied is located (the source cartridge) is mounted in the drive and data is read from the cartridge into a memory buffer in the library controller or some other location. When the buffer is full, or if all of the data has been read without completely filling the buffer, the source cartridge is removed and another cartridge (the target cartridge) is mounted. Data is then copied from the buffer to the target cartridge. The process is repeated until all of the data has been copied from the source to the target.
On the other hand, if the library is equipped with two or more drives, a "multi-threaded" procedure is employed as follows: both the source cartridge and the target cartridge are loaded into two of the available drives. Data is copied from the source first into one buffer and then into another; while the data is being copied into the second buffer, the data in the first buffer is written to the target. When the second buffer is full and the first buffer is "empty" (completely copied to the target), the process reverses whereby data is copied into the first buffer while the data in the second buffer is written to the target.
It will be apparent that, while the multi-threaded approach can be used in a single-drive library, it can cause "race conditions" when attempting to access the source and target cartridges, thereby resulting in unnecessary cartridge swaps and mounts. It will also be apparent that a single-threaded approach can be used in a multi-drive library but would not take advantage of the efficiency and speed provided by multiple drives. However, even in a multi-drive library, there may be situations in which only one drive is available or functional, for example if the other drives are occupied or out of service. In such situations, a multi-threaded process performs poorly, causing many cartridge mounts, and a single-threaded process is not typically available.